#!/bin/bash

docker_name=centos_test
docker_image=centos:latest
docker_data_dir=/data/${docker_name}_data
alb_install_dir=${docker_data_dir}/alb_install_dir

docker stop $docker_name
docker rm $docker_name

if [ -d $docker_data_dir ]
then
    echo "存在目录: $docker_data_dir"
    rm $docker_data_dir/* -rf
else
    echo "不存在目录: $docker_data_dir"
    mkdir $docker_data_dir
fi

tar -xzf /data/alb_x86_install_package.tar.gz -C $docker_data_dir

docker run -d -it -v $docker_data_dir:/data -p 7000:9000 -p 7080:9080  --name $docker_name $docker_image

# docker exec -it $docker_name /bin/bash -c "cd /data/alb_x86_install_package && ./run.sh"
